package com.situ.day24;

import org.junit.Test;

import java.lang.reflect.Method;
import java.util.Arrays;

//@Author(name = "zhangsan", age = 23)
//@Author(value = "男")
//@Author("男"})
@Author({"男", "女"})
public class AuthorDemo {

    @Author
    private String str;

    @Author(name = "lisi")
    public void add() {

    }

    @Test
    public void test1() throws NoSuchMethodException {
        Class<AuthorDemo> clazz = AuthorDemo.class;
        Author authorType = clazz.getAnnotation(Author.class);
        System.out.println(authorType.name());
        System.out.println(authorType.age());
        System.out.println(Arrays.toString(authorType.value()));

        Method method = clazz.getMethod("add");
        Author authorMethod = method.getAnnotation(Author.class);
        System.out.println(authorMethod.name());
        System.out.println(authorMethod.age());


    }
}
